def prevnext
end

# http://bulknews.net/lib/archives/prevnextentry-0.1
def prevnext_prev_and_next
  files = []
  @file_extension.each do |fext|
    files += Dir.glob("#{@datadir}/**/*.#{fext}")
  end
  files = files.sort_by {|f| File.mtime(f)}
  idx = files.index(@datadir + @options.path)
  return unless idx
  
   _ = '<div id="prevnext">'
	if 0 < idx
		_ << '&laquo; '
		_ << prevnext_make_link(files[idx - 1])
		_ << ' | '
	end
	_ << %Q(<a href="#{@url}/">Main</a>)
	if files.size > idx + 1
		_ << ' | '
		_ << prevnext_make_link(files[idx + 1])
		_ << ' &raquo;'
	end
	_ << '</div>'
	_
end

def prevnext_make_link(filepath)
	return '' unless filepath
	title = IO.readlines(filepath)[0].chomp
	href = filepath.sub(/#{@datadir}\/(.*)\.(.*?)$/) {
		"#{@url}/#{$1}.html"
	}
	%Q(<a href="#{href}">#{title}</a>)
end
